﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>验证手机</title>
    <link href="plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="plugins/font-awesome-4.3.0/css/font-awesome.min.css" rel="stylesheet"
        type="text/css" />
    <link rel="stylesheet" type="text/css" href="css/css.css" />
    <link rel="stylesheet" type="text/css" href="css/base.css" />
    <link href="css/gl.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="top">
        <div class="media top-nav-body">
            <div class="media-left" onclick="goBack();">
                <div class="top-left">
                    <i class="fa fa-angle-left"></i>
                </div>
            </div>
            <div class="media-body">
                <div class="top-title">
                    验证手机</div>
            </div>
            <div class="media-right" onclick="toUrl('login.html');">
                <div class="top-right">
                    </div>
            </div>
        </div>
    </div>
    <div class="container-fluid mt50">
        <form action="Ajax/User.ashx?ValidatePhone" method="post">
        <input name="phone" id="phone" class="form-control" value="" readonly />
        <div class="input-group mt10">
            <input type="text" name="code" class="form-control" placeholder="验证码" require="true"
                tips="请输入验证码" />
            <div id="code" class="input-group-addon">
                <span>获取验证码</span>
            </div>
        </div>
        <button class="btn btn-normal btn-block mt20">
            提交</button>
        </form>
    </div>
    <script src="js/jquery-2.1.4.min.js" type="text/javascript"></script>
    <script src="js/jquery-form.js" type="text/javascript"></script>
    <script src="plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="js/jquery-submit-1.1.js" type="text/javascript"></script>
    <script src="js/gl-dialog.js" type="text/javascript"></script>
    <script src="js/base.js" type="text/javascript"></script>
    <script src="js/gl.js" type="text/javascript"></script>
    <script>
        $(function () {
            init();
            getUserInfo();
        });
        function init() {

            //绑定获取短信验证码按钮
            bindCodeEvent("modify")

            //提交表单
            $('form').submit(function () {
                if (callSubmit(this)) {
                    ajaxSubmit({
                        callback: function (data) {
                            GlToast({ body: "验证成功", onClose: function () {
                                goBack();
                            }
                            });
                        }
                    });
                }
                return false;
            });
        }

        //获取用户信息
        function getUserInfo() {
            ajaxJson({ url: "Ajax/User.ashx?GetDetail", callback: function (data) {
                if (data.phone == "" || data.phone == null) {

                    //没有绑定手机,跳转到绑定手机页面
                    window.location.href = "reset-phone.html";
                    return;
                }
                $("#phone").val(data.phone);
                $("#code").click();
            }
            });
        }
    </script>
</body>
</html>
